<?php
/**
 * Created by PhpStorm.
 * User: wangye
 * Date: 19-2-14
 * Time: 下午8:01
 */
class Solution {
    public static function twoSum($nums, $target) {
        $rst = [];
        for($i=0;$i<count($nums);$i++){
            for ($j=0;$j<count($nums);$j++){
                if ($nums[$j]+$nums[$i]==$target){
                    array_push($rst,$i,$j);
                    break;
                }
            }
        }
//        return array_unique($rst);
        return $rst;
    }
}
$res = Solution::twoSum([3,2,4],6);
var_dump($res);